FROM ubuntu
MAINTAINER askyer <johnskyer@126.com>

ENV DEBIAN_FRONTEND noninteractive
WORKDIR /app
RUN apt-get -y install wget
RUN wget -q -O - http://www.dotdeb.org/dotdeb.gpg | sudo apt-key add - &&\
	apt-get update 
RUN apt-get install -yq redis-server

RUN mkdir /data && sed -i 's/daemonize yes/daemonize no/' /etc/redis/redis.conf  &&\
	sed -i 's|dir /var/lib/redis|dir /data|' /etc/redis/redis.conf &&\
	sed -i 's/bind 127.0.0.1/#bind 127.0.0.1/' /etc/redis/redis.conf

RUN rm -rf /var/lib/apt/lists/* && rm -f /app/redis-stable.tar.gz

VOLUME ["/data"]
EXPOSE 6379
CMD ["/usr/bin/redis-server","/etc/redis/redis.conf"]
 
